package bupt.party.online.service.impl;

import java.util.List;

import bupt.party.online.dao.ILearnCenterDao;
import bupt.party.online.model.LearnCenter;
import bupt.party.online.service.ILearnCenterService;

public class LearnCenterServiceImpl implements ILearnCenterService {

	private ILearnCenterDao learnCenterDao;
	
	public ILearnCenterDao getLearnCenterDao() {
		return learnCenterDao;
	}

	public void setLearnCenterDao(ILearnCenterDao learnCenterDao) {
		this.learnCenterDao = learnCenterDao;
	}

	public void saveLearnCenter(LearnCenter learnCenter) {
		learnCenterDao.saveLearnCenter(learnCenter);
	}

	public void deleteLearnCenter(LearnCenter learnCenter) {
		learnCenterDao.deleteLearnCenter(learnCenter);
	}

	public void updateLearnCenter(LearnCenter learnCenter) {
		learnCenterDao.updateLearnCenter(learnCenter);
	}

	public List<LearnCenter> findLearnCenterByTitle(String title, Integer tag,
			int first, int pageSize) {
		return this.learnCenterDao.findLearnCenterByTitle(title, tag, first, pageSize);
	}

	public int findLearnCenterCountByTitle(String title, Integer tag) {
		return this.learnCenterDao.findLearnCenterCountByTitle(title, tag);
	}

	public LearnCenter findLearnCenterById(Integer id) {
		return this.learnCenterDao.findLearnCenterById(id);
	}

	public void addLearnCenterVisitsCount(Integer id) {
		this.learnCenterDao.addLearnCenterVisitsCount(id);
	}

	public void deleteLearnCenterById(Integer id) {
		this.learnCenterDao.deleteLearnCenterById(id);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List findAdminLearnCenterByTitle(String title, Integer tag,
			int first, int pageSize) {
		return this.learnCenterDao.findAdminLearnCenterByTitle(title, tag, first, pageSize);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List getLatest4Notices() {
		return this.learnCenterDao.getLatest4Notices();
	}

}
